/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.hazardsource.mapper;

import com.koron.hazardsource.domain.IndicationType;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IndicationTypeMapper {

    /**
     * 新增指标类型
     * @param bean
     * @return
     */
    Integer insert(@Param("bean") IndicationType bean);

    /**
     * 修改指标类型
     * @param bean
     * @return
     */
    Integer update(@Param("bean") IndicationType bean);

    /**
     * 根据主键批量删除指标类型
     * @param idList
     * @return
     */
    Integer batchDetele(@Param("idList") List<String> idList);

    /**
     * 根据主键查询指标类型
     * @param id
     * @return
     */
    IndicationType queryOne(String id);

    /**
     * 查询所有指标类型，可分页
     * @param start
     * @param rows
     * @return
     */
    List<IndicationType> queryAll(@Param("start") Integer start,@Param("rows") Integer rows);

    /**
     * 统计所有指标类型
     * @return
     */
    Integer countAll();

    /**
     * 判断指标类型名称或者指标类型key是否存在相同的
     * @param name
     * @param typeKey
     * @return
     */
   Integer isExistByNameOrKey(@Param("name") String name,@Param("typeKey") String typeKey);

    /**
     * 判断指标类型名称或者指标类型key是否存在相同的（去除本身）
     * @param id
     * @param name
     * @param typeKey
     * @return
     */
   Integer isExistByNameOrKeyExcludeSelf(@Param("id") String id,@Param("name") String name,@Param("typeKey") String typeKey);

    /**
     * 根据key查询指标类型数据
     * @param typeKey
     * @return
     */
   IndicationType queryByKey(@Param("typeKey") String typeKey);

    /**
     * 批量修改指标类型数据
     * @param typeList
     * @return
     */
   Integer batchUpdate(@Param("typeList") List<IndicationType> typeList);
}
